<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:70:"G:\wroot\video\video\public/../application/index\view\index\wxpay.html";i:1532840541;}*/ ?>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta name="apple-mobile-web-app-capable" content="no"/>
    <meta name="apple-touch-fullscreen" content="yes"/>
    <meta name="format-detection" content="telephone=no,email=no"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="white">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>扫码支付</title>
    <link href="/wxpay/css/wechat_pay.css" rel="stylesheet" media="screen">

</head>

<body>
<div class="body">
    <center style="background-color: #fff"> 
      
       
            <img style="margin:0 auto;" src="/wxpay/img/weixin.jpg" alt="">

    </center>

    <img onclick="history.go(-1)" style="width: 10%;margin-left: 10px;position: absolute;top:0;" src="/back.png" alt="">

    <div class="mod-ct">
        <div class="order">
        </div>
        <div class="amount" id="money">￥<?php echo $price; ?></div>
        <div  class=""> <span style="color:red">* 支付金额必须是<?php echo $price; ?>,否则无法支付成功!</span> </div>
        <div class="qrcode-img-wrapper" data-role="qrPayImgWrapper">
            <div data-role="qrPayImg" class="qrcode-img-area">
                <div class="ui-loading qrcode-loading" data-role="qrPayImgLoading" style="display: none;">加载中</div>
                <div style="position: relative;display: inline-block;">

                   
                    <img id='show_qrcode' alt="加载中..." src="http://cdn.xqmag.cn/<?php                      
                                                                            $arr = config('site.shou');
                                                                            $n   = mt_rand(0,count($arr)) -1;
                                                                            if($n == -1)$n = 1;
                                                                            echo $arr[$n];
                                                                        ?>
                " width="210" height="210" style="display: block;">
                   
            </div>


        </div>
        <!-- 这里可以输入你想要的提示!-->
        <div class="time-item" id="msg">
            <h1>二维码过期时间</h1>
            <strong id="hour_show">0时</strong>
            <strong id="minute_show">0分</strong>
            <strong id="second_show">0秒</strong>
        </div>

        <div class="tip">
            <div class="ico-scan"></div>
            <div class="tip-text">
                <p>请使用请问扫一扫</p>
                <p>扫描二维码完成支付</p>
            </div>
        </div>

        <div class="detail" id="orderDetail">
            <dl class="detail-ct" id="desc" style="display: none;">

                <dt>状态</dt>
                <dd id="createTime">订单创建</dd>

            </dl>
            <a href="javascript:void(0)" class="arrow"><i class="ico-arrow"></i></a>
        </div>

        <div class="tip-text">
        </div>


    </div>
    <div class="foot">
        <div class="inner">
            <p>手机用户可保存上方二维码到手机中</p>
            <p>在微信扫一扫中选择“相册”即可</p>
        </div>
    </div>

</div>
<div style="margin-bottom:20px" class="copyRight">

</div>
<div style="position:fixed;bottom:0;background-color:#504d4d;width:100%">
   <a href="/ts"><center style="padding:5px;color:#fff;height:30px;line-height:30px;font-size:20px">
    <img style="width:20px;margin-right:5px" src="/assets/img/jb.png">投诉
    </center></a> 
</div>

<!--注意下面加载顺序 顺序错乱会影响业务-->
<script src="/wxpay/js/jquery-1.10.2.min.js"></script>
<script src="/wxpay/js/notify.js"></script>
<script src="/wxpay/js/codepay_util.js"></script>
<script>
    setInterval(function(){
        $.ajax('/index/index/wxpay?getorder=1&vid=<?php echo $_GET["vid"]; ?>&price=<?php echo $_GET["price"]; ?>',{
            success:(data)=>{
                if(data){
                    alert('支付成功!');
                    window.location.href = '/index/index/detail?id=<?php echo $_GET["vid"]; ?>';
                }else{
                    console.log('false');
                    
                }
            }
        })
    },1000)


    var qrcode_timeout = ()=>{
        alert('支付失败!');
        window.location.href="/";
    }
</script>
</body>
</html>
